using System.Linq;
using System.Text;
using System.Diagnostics;
using System.Runtime.Serialization;
using System.Collections;
using System.Data;
using System.ComponentModel;
using System.Data.OracleClient;
using WPFExcelReport.Helpers;
using WPFExcelReport.Controls;
namespace WPFExcelReport
{
    public partial class VWTEINZ
    {
        public void SetUpNewRow(ref DataRow dwReturn)
        {

            switch (app.company)
            {
                case "YGR":
                case "TST":
                case "UBT":
                case "SXN":
                default:
                    #region=========
                    dwReturn["WTEMANDANT"] = "00";
                    dwReturn["WTEEINZNR"] = "R08            ";
                    dwReturn["WTESTAKZ"] = "A";
                    dwReturn["WTEBEZ"] = "R08                           ";
                    dwReturn["WTEEZ"] = "2";
                    dwReturn["WTEERSFD"] = "0";
                    dwReturn["WTERAPP"] = "0";
                    dwReturn["WTEEZWBL"] = "                                        ";
                    dwReturn["WTEESTBRT"] = "                                        ";
                    dwReturn["WTEWBLBRT"] = "0";
                    dwReturn["WTEWBLTL"] = " ";
                    dwReturn["WTELSL01"] = "0";
                    dwReturn["WTEGEW01"] = "0";
                    dwReturn["WTELSR01"] = "0";
                    dwReturn["WTELEER01"] = "0";
                    dwReturn["WTELSL02"] = "0";
                    dwReturn["WTEGEW02"] = "0";
                    dwReturn["WTELSR02"] = "0";
                    dwReturn["WTELEER02"] = "0";
                    dwReturn["WTELSL03"] = "0";
                    dwReturn["WTEGEW03"] = "0";
                    dwReturn["WTELSR03"] = "0";
                    dwReturn["WTELEER03"] = "0";
                    dwReturn["WTELSL04"] = "0";
                    dwReturn["WTEGEW04"] = "0";
                    dwReturn["WTELSR04"] = "0";
                    dwReturn["WTELEER04"] = "0";
                    dwReturn["WTELSL05"] = "0";
                    dwReturn["WTEGEW05"] = "0";
                    dwReturn["WTELSR05"] = "0";
                    dwReturn["WTELEER05"] = "0";
                    dwReturn["WTEAENDZL"] = "1";
                    dwReturn["WTEAENDBEN"] = "INTEXE  ";
                    dwReturn["WTEAENDDAT"] = "20151031";
                    dwReturn["WTENEUBEN"] = "INTEXE  ";
                    dwReturn["WTENEUDAT"] = "20151031";
                    dwReturn["WTEFILLER"] = "                                          ";
                    #endregion
                    break;
                case "JLT":

                    break;
            }
        }
        public void MapWTEINZ(ref DataRow dwLocal, DataRow dwData)
        {
            BlindMap(ref dwLocal, dwData);
        }
        public void SaveWTEINZ(DataRow dwData, string ITXDBVERSION = "50.24")
        {
            DataSet setResult = new DataSet();
            DataTable tbLocal = null;
            DataRow dwLocal = null;
            bool flgExist = false;
            setResult = QueryWTEINZ(dwData);
            if (setResult.Tables.Count > 0)
            {
                tbLocal = setResult.Tables[0];
                if (tbLocal.Rows.Count > 0)
                {
                    flgExist = true;
                    dwLocal = tbLocal.Rows[0];
                }
                else
                {
                    dwLocal = tbLocal.NewRow();
                }
            }

            MapWTEINZ(ref dwLocal, dwData);

            if (!flgExist)
            {
                InsertWTEINZ(dwLocal);
            }
            UpdateWTEINZ(dwLocal);
        }
        public void InsertWTEINZ(DataRow dwData, string ITXDBVERSION = "50.24")
        {
            or1 = OracleDB.CreateCommand();
            switch (app.company)
            {
                case "JLT":
                    or1.CommandText = "INSERT INTO WTEINZ(WTEMANDANT, WTEEINZNR, WTESTAKZ, WTEBEZ, WTEEZ, WTEERSFD, WTERAPP, WTEEZWBL, WTEESTBRT, WTEWBLBRT, WTEWBLTL, WTELSL01, WTEGEW01, WTELSR01, WTELEER01, WTELSL02, WTEGEW02, WTELSR02, WTELEER02, WTELSL03, WTEGEW03, WTELSR03, WTELEER03, WTELSL04, WTEGEW04, WTELSR04, WTELEER04, WTELSL05, WTEGEW05, WTELSR05, WTELEER05, WTEAENDZL, WTEAENDBEN, WTEAENDDAT, WTENEUBEN, WTENEUDAT, WTEFILLER)"
                        + " VALUES ("
                    + " :WTEMANDANT,:WTEEINZNR, 'A', '                              ', 'G', 0, 1, '2                                       ', '                                        ', 0, ' ', 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, '        ', 0, :WTENEUBEN, :WTENEUDAT, '                                          ')";
                    or1.Parameters.Add("WTEMANDANT", OracleType.NVarChar).Value = dwData["WTEMANDANT"].ToString();
                    or1.Parameters.Add("WTEEINZNR", OracleType.NVarChar).Value = dwData["WTEEINZNR"].ToString();
                    or1.Parameters.Add("WTENEUBEN", OracleType.NVarChar).Value = dwData["WTENEUBEN"].ToString();
                    or1.Parameters.Add("WTENEUDAT", OracleType.NVarChar).Value = dwData["WTENEUDAT"].ToString();
                    Connect2Proxy(or1);
                    break;
                case "YGR":
                case "TST":
                case "UBT":
                case "SXN":
                default:
                    or1.CommandText = "INSERT INTO WTEINZ ( WTEMANDANT,WTEEINZNR,WTESTAKZ,WTEBEZ,WTEEZ,WTEERSFD,WTERAPP,WTEEZWBL,WTEESTBRT,WTEWBLBRT,WTEWBLTL,WTELSL01,WTEGEW01,WTELSR01,WTELEER01,WTELSL02,WTEGEW02,WTELSR02,WTELEER02,WTELSL03,WTEGEW03,WTELSR03,WTELEER03,WTELSL04,WTEGEW04,WTELSR04,WTELEER04,WTELSL05,WTEGEW05,WTELSR05,WTELEER05,WTEAENDZL,WTEAENDBEN,WTEAENDDAT,WTENEUBEN,WTENEUDAT,WTEFILLER)"
                + " VALUES (:WTEMANDANT:,:WTEEINZNR:,:WTESTAKZ:,:WTEBEZ:,:WTEEZ:,:WTEERSFD:,:WTERAPP:,:WTEEZWBL:,:WTEESTBRT:,:WTEWBLBRT:,:WTEWBLTL:,:WTELSL01:,:WTEGEW01:,:WTELSR01:,:WTELEER01:,:WTELSL02:,:WTEGEW02:,:WTELSR02:,:WTELEER02:,:WTELSL03:,:WTEGEW03:,:WTELSR03:,:WTELEER03:,:WTELSL04:,:WTEGEW04:,:WTELSR04:,:WTELEER04:,:WTELSL05:,:WTEGEW05:,:WTELSR05:,:WTELEER05:,:WTEAENDZL:,:WTEAENDBEN:,:WTEAENDDAT:,:WTENEUBEN:,:WTENEUDAT:,:WTEFILLER:)";
                    or1.CommandText = INTEXDBC.InjectData(or1.CommandText, dwData);
                    Connect2Proxy(or1);
                    break;

            }

        }
        public void DeleteWTEINZ(string client, string art)
        {

            or1 = OracleDB.CreateCommand();
            or1.CommandText = "DELETE WTEINZ WHERE WTEMANDANT=:WTEMANDANT AND WTEEINZNR=:WTEEINZNR";
            or1.Parameters.Add("WTEMANDANT", OracleType.NVarChar).Value = client;
            or1.Parameters.Add("WTEEINZNR", OracleType.NVarChar).Value = art;
            Connect2Proxy(or1);
        }
        public void DWTE01(DataRow dwData)
        {

            or1 = OracleDB.CreateCommand();
            or1.CommandText = "DELETE WTEINZ WHERE WTEMANDANT=:WTEMANDANT: AND WTEEINZNR=:WTEEINZNR:";
            or1.CommandText = INTEXDBC.InjectData(or1.CommandText, dwData);
            Connect2Proxy(or1);
        }
        public DataSet QueryWTEINZ(DataRow dwData, int option = 0)
        {
            switch (option)
            {
                case 1:
                    SResult = QWTEINZ01(dwData);
                    break;
            }
            return SResult;
        }
        public DataSet QWTEINZ01(DataRow dwData)
        {

            or1 = OracleDB.CreateCommand();
            or1.CommandText = "SELECT *FROM  WTEINZ "
                + "  WHERE WTEMANDANT=:WTEMANDANT: AND WTESTAKZ='A' AND WTEEINZNR=:WTEEINZNR:";
            or1.CommandText = INTEXDBC.InjectData(or1.CommandText, dwData);
            SResult = Connect2Proxy(or1);
            SResult.Tables[0].TableName = TableName;

            return SResult;
        }
        public DataSet QWTEINZ02(DataRow dwData)
        {

            or1 = OracleDB.CreateCommand();
            or1.CommandText = "SELECT WTEEINZNR,WTEEINZNR AS KEY,WTEBEZ  AS DES FROM  WTEINZ "
                + "  WHERE WTEMANDANT=:WTEMANDANT:  AND WTESTAKZ='A'";
            or1.CommandText = INTEXDBC.InjectData(or1.CommandText, dwData);
            SResult = Connect2Proxy(or1);
            SResult.Tables[0].TableName = TableName;

            return SResult;
        }
        public DataSet QWTEINZ03(DataRow dwData)
        {

            or1 = OracleDB.CreateCommand();
            or1.CommandText = "SELECT *FROM  WTEINZ "
                + "  WHERE WTEMANDANT=:WTEMANDANT: AND WTESTAKZ='A'  "
                + dwData["WTEEINZNR"].ToString()
                + " ORDER BY WTEEINZNR";
            or1.CommandText = INTEXDBC.InjectData(or1.CommandText, dwData);
            SResult = Connect2Proxy(or1);
            SResult.Tables[0].TableName = TableName;

            return SResult;
        }
        public DataSet QWTEINZ04(DataRow dwData)
        {

            or1 = OracleDB.CreateCommand();
            or1.CommandText = "SELECT P.*"
                + ", 0 AS D0000,0 AS D0001,0 AS D0002,0 AS D0003,0 AS D0004,0 AS D0005,0 AS D0006,0 AS D0007,0 AS D0008,0 AS D0009"
                + ", 0 AS D0010,0 AS D0011,0 AS D0012,0 AS D0013,0 AS D0014,0 AS D0015,0 AS D0016,0 AS D0017,0 AS D0018,0 AS D0019"
                + ", 0 AS D0020,0 AS D0021,0 AS D0022,0 AS D0023,0 AS D0024,0 AS D0025,0 AS D0026,0 AS D0027,0 AS D0028,0 AS D0029"
                + ", 0 AS D0030,0 AS D0031,0 AS D0032,0 AS D0033,0 AS D0034,0 AS D0035,0 AS D0036,0 AS D0037,0 AS D0038,0 AS D0039"
                /*
                + ", 0 AS D0040,0 AS D0041,0 AS D0042,0 AS D0043,0 AS D0044,0 AS D0045,0 AS D0046,0 AS D0047,0 AS D0048,0 AS D0049"
                + ", 0 AS D0050,0 AS D0051,0 AS D0052,0 AS D0053,0 AS D0054,0 AS D0055,0 AS D0056,0 AS D0057,0 AS D0058,0 AS D0059"
                + ", 0 AS D0060,0 AS D0061,0 AS D0062,0 AS D0063,0 AS D0064,0 AS D0065,0 AS D0066,0 AS D0067,0 AS D0068,0 AS D0069"
                + ", 0 AS D0070,0 AS D0071,0 AS D0072,0 AS D0073,0 AS D0074,0 AS D0075,0 AS D0076,0 AS D0077,0 AS D0078,0 AS D0079"
                + ", 0 AS D0080,0 AS D0081,0 AS D0082,0 AS D0083,0 AS D0084,0 AS D0085,0 AS D0086,0 AS D0087,0 AS D0088,0 AS D0089"
                + ", 0 AS D0090,0 AS D0091,0 AS D0092,0 AS D0093,0 AS D0094,0 AS D0095,0 AS D0096,0 AS D0097,0 AS D0098,0 AS D0099"
                + ", 0 AS D0100,0 AS D0101,0 AS D0102,0 AS D0103,0 AS D0104,0 AS D0105,0 AS D0106,0 AS D0107,0 AS D0108,0 AS D0109"
                + ", 0 AS D0110,0 AS D0111,0 AS D0112,0 AS D0113,0 AS D0114,0 AS D0115,0 AS D0116,0 AS D0117,0 AS D0118,0 AS D0119"
                + ", 0 AS D0120,0 AS D0121,0 AS D0122,0 AS D0123,0 AS D0124,0 AS D0125,0 AS D0126,0 AS D0127,0 AS D0128,0 AS D0129"
                + ", 0 AS D0130,0 AS D0131,0 AS D0132,0 AS D0133,0 AS D0134,0 AS D0135,0 AS D0136,0 AS D0137,0 AS D0138,0 AS D0139"
                + ", 0 AS D0140,0 AS D0141,0 AS D0142,0 AS D0143,0 AS D0144,0 AS D0145,0 AS D0146,0 AS D0147,0 AS D0148,0 AS D0149"
                + ", 0 AS D0150,0 AS D0151,0 AS D0152,0 AS D0153,0 AS D0154,0 AS D0155,0 AS D0156,0 AS D0157,0 AS D0158,0 AS D0159"
                + ", 0 AS D0160,0 AS D0161,0 AS D0162,0 AS D0163,0 AS D0164,0 AS D0165,0 AS D0166,0 AS D0167,0 AS D0168,0 AS D0169"
                + ", 0 AS D0170,0 AS D0171,0 AS D0172,0 AS D0173,0 AS D0174,0 AS D0175,0 AS D0176,0 AS D0177,0 AS D0178,0 AS D0179"
                + ", 0 AS D0180,0 AS D0181,0 AS D0182,0 AS D0183,0 AS D0184,0 AS D0185,0 AS D0186,0 AS D0187,0 AS D0188,0 AS D0189"
                + ", 0 AS D0190,0 AS D0191,0 AS D0192,0 AS D0193,0 AS D0194,0 AS D0195,0 AS D0196,0 AS D0197,0 AS D0198,0 AS D0199"
                + ", 0 AS D0200,0 AS D0201,0 AS D0202,0 AS D0203,0 AS D0204,0 AS D0205,0 AS D0206,0 AS D0207,0 AS D0208,0 AS D0209"
                + ", 0 AS D0210,0 AS D0211,0 AS D0212,0 AS D0213,0 AS D0214,0 AS D0215,0 AS D0216,0 AS D0217,0 AS D0218,0 AS D0219"
                + ", 0 AS D0220,0 AS D0221,0 AS D0222,0 AS D0223,0 AS D0224,0 AS D0225,0 AS D0226,0 AS D0227,0 AS D0228,0 AS D0229"
                + ", 0 AS D0230,0 AS D0231,0 AS D0232,0 AS D0233,0 AS D0234,0 AS D0235,0 AS D0236,0 AS D0237,0 AS D0238,0 AS D0239"
                + ", 0 AS D0240,0 AS D0241,0 AS D0242,0 AS D0243,0 AS D0244,0 AS D0245,0 AS D0246,0 AS D0247,0 AS D0248,0 AS D0249"
                + ", 0 AS D0250,0 AS D0251,0 AS D0252,0 AS D0253,0 AS D0254,0 AS D0255,0 AS D0256,0 AS D0257,0 AS D0258,0 AS D0259"
                + ", 0 AS D0260,0 AS D0261,0 AS D0262,0 AS D0263,0 AS D0264,0 AS D0265,0 AS D0266,0 AS D0267,0 AS D0268,0 AS D0269"
                + ", 0 AS D0270,0 AS D0271,0 AS D0272,0 AS D0273,0 AS D0274,0 AS D0275,0 AS D0276,0 AS D0277,0 AS D0278,0 AS D0279"
                + ", 0 AS D0280,0 AS D0281,0 AS D0282,0 AS D0283,0 AS D0284,0 AS D0285,0 AS D0286,0 AS D0287,0 AS D0288,0 AS D0289"
                + ", 0 AS D0290,0 AS D0291,0 AS D0292,0 AS D0293,0 AS D0294,0 AS D0295,0 AS D0296,0 AS D0297,0 AS D0298,0 AS D0299"
                + ", 0 AS D0300,0 AS D0301,0 AS D0302,0 AS D0303,0 AS D0304,0 AS D0305,0 AS D0306,0 AS D0307,0 AS D0308,0 AS D0309"
                + ", 0 AS D0310,0 AS D0311,0 AS D0312,0 AS D0313,0 AS D0314,0 AS D0315,0 AS D0316,0 AS D0317,0 AS D0318,0 AS D0319"
                + ", 0 AS D0320,0 AS D0321,0 AS D0322,0 AS D0323,0 AS D0324,0 AS D0325,0 AS D0326,0 AS D0327,0 AS D0328,0 AS D0329"
                + ", 0 AS D0330,0 AS D0331,0 AS D0332,0 AS D0333,0 AS D0334,0 AS D0335,0 AS D0336,0 AS D0337,0 AS D0338,0 AS D0339"
                + ", 0 AS D0340,0 AS D0341,0 AS D0342,0 AS D0343,0 AS D0344,0 AS D0345,0 AS D0346,0 AS D0347,0 AS D0348,0 AS D0349"
                + ", 0 AS D0350,0 AS D0351,0 AS D0352,0 AS D0353,0 AS D0354,0 AS D0355,0 AS D0356,0 AS D0357,0 AS D0358,0 AS D0359"
                + ", 0 AS D0360,0 AS D0361,0 AS D0362,0 AS D0363,0 AS D0364,0 AS D0365,0 AS D0366,0 AS D0367,0 AS D0368,0 AS D0369"
                + ", 0 AS D0370,0 AS D0371,0 AS D0372,0 AS D0373,0 AS D0374,0 AS D0375,0 AS D0376,0 AS D0377,0 AS D0378,0 AS D0379"
                + ", 0 AS D0380,0 AS D0381,0 AS D0382,0 AS D0383,0 AS D0384,0 AS D0385,0 AS D0386,0 AS D0387,0 AS D0388,0 AS D0389"
                + ", 0 AS D0390,0 AS D0391,0 AS D0392,0 AS D0393,0 AS D0394,0 AS D0395,0 AS D0396,0 AS D0397,0 AS D0398,0 AS D0399"
                + ", 0 AS D0400,0 AS D0401,0 AS D0402,0 AS D0403,0 AS D0404,0 AS D0405,0 AS D0406,0 AS D0407,0 AS D0408,0 AS D0409"
                + ", 0 AS D0410,0 AS D0411,0 AS D0412,0 AS D0413,0 AS D0414,0 AS D0415,0 AS D0416,0 AS D0417,0 AS D0418,0 AS D0419"
                + ", 0 AS D0420,0 AS D0421,0 AS D0422,0 AS D0423,0 AS D0424,0 AS D0425,0 AS D0426,0 AS D0427,0 AS D0428,0 AS D0429"
                + ", 0 AS D0430,0 AS D0431,0 AS D0432,0 AS D0433,0 AS D0434,0 AS D0435,0 AS D0436,0 AS D0437,0 AS D0438,0 AS D0439"
                + ", 0 AS D0440,0 AS D0441,0 AS D0442,0 AS D0443,0 AS D0444,0 AS D0445,0 AS D0446,0 AS D0447,0 AS D0448,0 AS D0449"
                + ", 0 AS D0450,0 AS D0451,0 AS D0452,0 AS D0453,0 AS D0454,0 AS D0455,0 AS D0456,0 AS D0457,0 AS D0458,0 AS D0459"
                + ", 0 AS D0460,0 AS D0461,0 AS D0462,0 AS D0463,0 AS D0464,0 AS D0465,0 AS D0466,0 AS D0467,0 AS D0468,0 AS D0469"
                + ", 0 AS D0470,0 AS D0471,0 AS D0472,0 AS D0473,0 AS D0474,0 AS D0475,0 AS D0476,0 AS D0477,0 AS D0478,0 AS D0479"
                + ", 0 AS D0480,0 AS D0481,0 AS D0482,0 AS D0483,0 AS D0484,0 AS D0485,0 AS D0486,0 AS D0487,0 AS D0488,0 AS D0489"
                + ", 0 AS D0490,0 AS D0491,0 AS D0492,0 AS D0493,0 AS D0494,0 AS D0495,0 AS D0496,0 AS D0497,0 AS D0498,0 AS D0499"*/
                + "  FROM  WTEINZ P "
                + "  WHERE WTEMANDANT=:WTEMANDANT: AND WTESTAKZ='D' "
                + dwData["WTEEINZNR"].ToString()
                + " ORDER BY WTEEINZNR"
                ;
            or1.CommandText = INTEXDBC.InjectData(or1.CommandText, dwData);
            SResult = Connect2Proxy(or1);
            SResult.Tables[0].TableName = TableName;

            return SResult;
        }
        public DataSet QWTDF(DataRow dwData)
        {

            or1 = OracleDB.CreateCommand();
            or1.CommandText = "SELECT 0 AS LINE, P.*"
                + ", 0 AS D0000,0 AS D0001,0 AS D0002,0 AS D0003,0 AS D0004,0 AS D0005,0 AS D0006,0 AS D0007,0 AS D0008,0 AS D0009"
                + ", 0 AS D0010,0 AS D0011,0 AS D0012,0 AS D0013,0 AS D0014,0 AS D0015,0 AS D0016,0 AS D0017,0 AS D0018,0 AS D0019"
                + ", 0 AS D0020,0 AS D0021,0 AS D0022,0 AS D0023,0 AS D0024,0 AS D0025,0 AS D0026,0 AS D0027,0 AS D0028,0 AS D0029"
                + ", 0 AS D0030,0 AS D0031,0 AS D0032,0 AS D0033,0 AS D0034,0 AS D0035,0 AS D0036,0 AS D0037,0 AS D0038,0 AS D0039"
                /*
                + ", 0 AS D0040,0 AS D0041,0 AS D0042,0 AS D0043,0 AS D0044,0 AS D0045,0 AS D0046,0 AS D0047,0 AS D0048,0 AS D0049"
                + ", 0 AS D0050,0 AS D0051,0 AS D0052,0 AS D0053,0 AS D0054,0 AS D0055,0 AS D0056,0 AS D0057,0 AS D0058,0 AS D0059"
                + ", 0 AS D0060,0 AS D0061,0 AS D0062,0 AS D0063,0 AS D0064,0 AS D0065,0 AS D0066,0 AS D0067,0 AS D0068,0 AS D0069"
                + ", 0 AS D0070,0 AS D0071,0 AS D0072,0 AS D0073,0 AS D0074,0 AS D0075,0 AS D0076,0 AS D0077,0 AS D0078,0 AS D0079"
                + ", 0 AS D0080,0 AS D0081,0 AS D0082,0 AS D0083,0 AS D0084,0 AS D0085,0 AS D0086,0 AS D0087,0 AS D0088,0 AS D0089"
                + ", 0 AS D0090,0 AS D0091,0 AS D0092,0 AS D0093,0 AS D0094,0 AS D0095,0 AS D0096,0 AS D0097,0 AS D0098,0 AS D0099"
                + ", 0 AS D0100,0 AS D0101,0 AS D0102,0 AS D0103,0 AS D0104,0 AS D0105,0 AS D0106,0 AS D0107,0 AS D0108,0 AS D0109"
                + ", 0 AS D0110,0 AS D0111,0 AS D0112,0 AS D0113,0 AS D0114,0 AS D0115,0 AS D0116,0 AS D0117,0 AS D0118,0 AS D0119"
                + ", 0 AS D0120,0 AS D0121,0 AS D0122,0 AS D0123,0 AS D0124,0 AS D0125,0 AS D0126,0 AS D0127,0 AS D0128,0 AS D0129"
                + ", 0 AS D0130,0 AS D0131,0 AS D0132,0 AS D0133,0 AS D0134,0 AS D0135,0 AS D0136,0 AS D0137,0 AS D0138,0 AS D0139"
                + ", 0 AS D0140,0 AS D0141,0 AS D0142,0 AS D0143,0 AS D0144,0 AS D0145,0 AS D0146,0 AS D0147,0 AS D0148,0 AS D0149"
                + ", 0 AS D0150,0 AS D0151,0 AS D0152,0 AS D0153,0 AS D0154,0 AS D0155,0 AS D0156,0 AS D0157,0 AS D0158,0 AS D0159"
                + ", 0 AS D0160,0 AS D0161,0 AS D0162,0 AS D0163,0 AS D0164,0 AS D0165,0 AS D0166,0 AS D0167,0 AS D0168,0 AS D0169"
                + ", 0 AS D0170,0 AS D0171,0 AS D0172,0 AS D0173,0 AS D0174,0 AS D0175,0 AS D0176,0 AS D0177,0 AS D0178,0 AS D0179"
                + ", 0 AS D0180,0 AS D0181,0 AS D0182,0 AS D0183,0 AS D0184,0 AS D0185,0 AS D0186,0 AS D0187,0 AS D0188,0 AS D0189"
                + ", 0 AS D0190,0 AS D0191,0 AS D0192,0 AS D0193,0 AS D0194,0 AS D0195,0 AS D0196,0 AS D0197,0 AS D0198,0 AS D0199"
                + ", 0 AS D0200,0 AS D0201,0 AS D0202,0 AS D0203,0 AS D0204,0 AS D0205,0 AS D0206,0 AS D0207,0 AS D0208,0 AS D0209"
                + ", 0 AS D0210,0 AS D0211,0 AS D0212,0 AS D0213,0 AS D0214,0 AS D0215,0 AS D0216,0 AS D0217,0 AS D0218,0 AS D0219"
                + ", 0 AS D0220,0 AS D0221,0 AS D0222,0 AS D0223,0 AS D0224,0 AS D0225,0 AS D0226,0 AS D0227,0 AS D0228,0 AS D0229"
                + ", 0 AS D0230,0 AS D0231,0 AS D0232,0 AS D0233,0 AS D0234,0 AS D0235,0 AS D0236,0 AS D0237,0 AS D0238,0 AS D0239"
                + ", 0 AS D0240,0 AS D0241,0 AS D0242,0 AS D0243,0 AS D0244,0 AS D0245,0 AS D0246,0 AS D0247,0 AS D0248,0 AS D0249"
                + ", 0 AS D0250,0 AS D0251,0 AS D0252,0 AS D0253,0 AS D0254,0 AS D0255,0 AS D0256,0 AS D0257,0 AS D0258,0 AS D0259"
                + ", 0 AS D0260,0 AS D0261,0 AS D0262,0 AS D0263,0 AS D0264,0 AS D0265,0 AS D0266,0 AS D0267,0 AS D0268,0 AS D0269"
                + ", 0 AS D0270,0 AS D0271,0 AS D0272,0 AS D0273,0 AS D0274,0 AS D0275,0 AS D0276,0 AS D0277,0 AS D0278,0 AS D0279"
                + ", 0 AS D0280,0 AS D0281,0 AS D0282,0 AS D0283,0 AS D0284,0 AS D0285,0 AS D0286,0 AS D0287,0 AS D0288,0 AS D0289"
                + ", 0 AS D0290,0 AS D0291,0 AS D0292,0 AS D0293,0 AS D0294,0 AS D0295,0 AS D0296,0 AS D0297,0 AS D0298,0 AS D0299"
                + ", 0 AS D0300,0 AS D0301,0 AS D0302,0 AS D0303,0 AS D0304,0 AS D0305,0 AS D0306,0 AS D0307,0 AS D0308,0 AS D0309"
                + ", 0 AS D0310,0 AS D0311,0 AS D0312,0 AS D0313,0 AS D0314,0 AS D0315,0 AS D0316,0 AS D0317,0 AS D0318,0 AS D0319"
                + ", 0 AS D0320,0 AS D0321,0 AS D0322,0 AS D0323,0 AS D0324,0 AS D0325,0 AS D0326,0 AS D0327,0 AS D0328,0 AS D0329"
                + ", 0 AS D0330,0 AS D0331,0 AS D0332,0 AS D0333,0 AS D0334,0 AS D0335,0 AS D0336,0 AS D0337,0 AS D0338,0 AS D0339"
                + ", 0 AS D0340,0 AS D0341,0 AS D0342,0 AS D0343,0 AS D0344,0 AS D0345,0 AS D0346,0 AS D0347,0 AS D0348,0 AS D0349"
                + ", 0 AS D0350,0 AS D0351,0 AS D0352,0 AS D0353,0 AS D0354,0 AS D0355,0 AS D0356,0 AS D0357,0 AS D0358,0 AS D0359"
                + ", 0 AS D0360,0 AS D0361,0 AS D0362,0 AS D0363,0 AS D0364,0 AS D0365,0 AS D0366,0 AS D0367,0 AS D0368,0 AS D0369"
                + ", 0 AS D0370,0 AS D0371,0 AS D0372,0 AS D0373,0 AS D0374,0 AS D0375,0 AS D0376,0 AS D0377,0 AS D0378,0 AS D0379"
                + ", 0 AS D0380,0 AS D0381,0 AS D0382,0 AS D0383,0 AS D0384,0 AS D0385,0 AS D0386,0 AS D0387,0 AS D0388,0 AS D0389"
                + ", 0 AS D0390,0 AS D0391,0 AS D0392,0 AS D0393,0 AS D0394,0 AS D0395,0 AS D0396,0 AS D0397,0 AS D0398,0 AS D0399"
                + ", 0 AS D0400,0 AS D0401,0 AS D0402,0 AS D0403,0 AS D0404,0 AS D0405,0 AS D0406,0 AS D0407,0 AS D0408,0 AS D0409"
                + ", 0 AS D0410,0 AS D0411,0 AS D0412,0 AS D0413,0 AS D0414,0 AS D0415,0 AS D0416,0 AS D0417,0 AS D0418,0 AS D0419"
                + ", 0 AS D0420,0 AS D0421,0 AS D0422,0 AS D0423,0 AS D0424,0 AS D0425,0 AS D0426,0 AS D0427,0 AS D0428,0 AS D0429"
                + ", 0 AS D0430,0 AS D0431,0 AS D0432,0 AS D0433,0 AS D0434,0 AS D0435,0 AS D0436,0 AS D0437,0 AS D0438,0 AS D0439"
                + ", 0 AS D0440,0 AS D0441,0 AS D0442,0 AS D0443,0 AS D0444,0 AS D0445,0 AS D0446,0 AS D0447,0 AS D0448,0 AS D0449"
                + ", 0 AS D0450,0 AS D0451,0 AS D0452,0 AS D0453,0 AS D0454,0 AS D0455,0 AS D0456,0 AS D0457,0 AS D0458,0 AS D0459"
                + ", 0 AS D0460,0 AS D0461,0 AS D0462,0 AS D0463,0 AS D0464,0 AS D0465,0 AS D0466,0 AS D0467,0 AS D0468,0 AS D0469"
                + ", 0 AS D0470,0 AS D0471,0 AS D0472,0 AS D0473,0 AS D0474,0 AS D0475,0 AS D0476,0 AS D0477,0 AS D0478,0 AS D0479"
                + ", 0 AS D0480,0 AS D0481,0 AS D0482,0 AS D0483,0 AS D0484,0 AS D0485,0 AS D0486,0 AS D0487,0 AS D0488,0 AS D0489"
                + ", 0 AS D0490,0 AS D0491,0 AS D0492,0 AS D0493,0 AS D0494,0 AS D0495,0 AS D0496,0 AS D0497,0 AS D0498,0 AS D0499"*/
                + ",SDKEY AS WTEEINZNR, SUBSTR(SDDATEN,62,8) AS VALUE, K.* FROM SDDAT P JOIN TXTIND T ON Txtitxtart='SDF' AND txtisind='0109'||SUBSTR(SDKEY,3)||'                                  '"
                + " JOIN TXTKON K ON TXTIPIND = TXTKPIND"
                 + " WHERE SDSA = '0109' AND SDKEY = :WTEEINZNR:"
                 + " ORDER BY TXTKPIND,TXTKPOS";
            // +" WHERE SDSA = '0109' AND SDKEY = '00E09                   '"
            //WTEEINZNR
            or1.CommandText = INTEXDBC.InjectData(or1.CommandText, dwData);
            SResult = Connect2Proxy(or1);
            SResult.Tables[0].TableName = TableName;

            return SResult;
        }
        public DataSet QWTPG(DataRow dwData)
        {

            or1 = OracleDB.CreateCommand();
            or1.CommandText = "SELECT  0 AS LINE, P.*"
                + ", 0 AS P0000,0 AS P0001,0 AS P0002,0 AS P0003,0 AS P0004,0 AS P0005,0 AS P0006,0 AS P0007,0 AS P0008,0 AS P0009"
                + ", 0 AS P0010,0 AS P0011,0 AS P0012,0 AS P0013,0 AS P0014,0 AS P0015,0 AS P0016,0 AS P0017,0 AS P0018,0 AS P0019"
                + ", 0 AS P0020,0 AS P0021,0 AS P0022,0 AS P0023,0 AS P0024,0 AS P0025,0 AS P0026,0 AS P0027,0 AS P0028,0 AS P0029"
                + ", 0 AS P0030,0 AS P0031,0 AS P0032,0 AS P0033,0 AS P0034,0 AS P0035,0 AS P0036,0 AS P0037,0 AS P0038,0 AS P0039" 
                + ", 0 AS P0040,0 AS P0041,0 AS P0042,0 AS P0043,0 AS P0044,0 AS P0045,0 AS P0046,0 AS P0047,0 AS P0048,0 AS P0049"
                + ", 0 AS P0050,0 AS P0051,0 AS P0052,0 AS P0053,0 AS P0054,0 AS P0055,0 AS P0056,0 AS P0057,0 AS P0058,0 AS P0059"
                + ", 0 AS P0060,0 AS P0061,0 AS P0062,0 AS P0063,0 AS P0064,0 AS P0065,0 AS P0066,0 AS P0067,0 AS P0068,0 AS P0069"
                + ", 0 AS P0070,0 AS P0071,0 AS P0072,0 AS P0073,0 AS P0074,0 AS P0075,0 AS P0076,0 AS P0077,0 AS P0078,0 AS P0079"
                /*+ ", 0 AS P0080,0 AS P0081,0 AS P0082,0 AS P0083,0 AS P0084,0 AS P0085,0 AS P0086,0 AS P0087,0 AS P0088,0 AS P0089"
                + ", 0 AS P0090,0 AS P0091,0 AS P0092,0 AS P0093,0 AS P0094,0 AS P0095,0 AS P0096,0 AS P0097,0 AS P0098,0 AS P0099"
                + ", 0 AS P0100,0 AS P0101,0 AS P0102,0 AS P0103,0 AS P0104,0 AS P0105,0 AS P0106,0 AS P0107,0 AS P0108,0 AS P0109"
                + ", 0 AS P0110,0 AS P0111,0 AS P0112,0 AS P0113,0 AS P0114,0 AS P0115,0 AS P0116,0 AS P0117,0 AS P0118,0 AS P0119"
                + ", 0 AS P0120,0 AS P0121,0 AS P0122,0 AS P0123,0 AS P0124,0 AS P0125,0 AS P0126,0 AS P0127,0 AS P0128,0 AS P0129"
                + ", 0 AS P0130,0 AS P0131,0 AS P0132,0 AS P0133,0 AS P0134,0 AS P0135,0 AS P0136,0 AS P0137,0 AS P0138,0 AS P0139"
                + ", 0 AS P0140,0 AS P0141,0 AS P0142,0 AS P0143,0 AS P0144,0 AS P0145,0 AS P0146,0 AS P0147,0 AS P0148,0 AS P0149"
                + ", 0 AS P0150,0 AS P0151,0 AS P0152,0 AS P0153,0 AS P0154,0 AS P0155,0 AS P0156,0 AS P0157,0 AS P0158,0 AS P0159"
                + ", 0 AS P0160,0 AS P0161,0 AS P0162,0 AS P0163,0 AS P0164,0 AS P0165,0 AS P0166,0 AS P0167,0 AS P0168,0 AS P0169"
                + ", 0 AS P0170,0 AS P0171,0 AS P0172,0 AS P0173,0 AS P0174,0 AS P0175,0 AS P0176,0 AS P0177,0 AS P0178,0 AS P0179"
                + ", 0 AS P0180,0 AS P0181,0 AS P0182,0 AS P0183,0 AS P0184,0 AS P0185,0 AS P0186,0 AS P0187,0 AS P0188,0 AS P0189"
                + ", 0 AS P0190,0 AS P0191,0 AS P0192,0 AS P0193,0 AS P0194,0 AS P0195,0 AS P0196,0 AS P0197,0 AS P0198,0 AS P0199"
                + ", 0 AS P0200,0 AS P0201,0 AS P0202,0 AS P0203,0 AS P0204,0 AS P0205,0 AS P0206,0 AS P0207,0 AS P0208,0 AS P0209"
                + ", 0 AS P0210,0 AS P0211,0 AS P0212,0 AS P0213,0 AS P0214,0 AS P0215,0 AS P0216,0 AS P0217,0 AS P0218,0 AS P0219"
                + ", 0 AS P0220,0 AS P0221,0 AS P0222,0 AS P0223,0 AS P0224,0 AS P0225,0 AS P0226,0 AS P0227,0 AS P0228,0 AS P0229"
                + ", 0 AS P0230,0 AS P0231,0 AS P0232,0 AS P0233,0 AS P0234,0 AS P0235,0 AS P0236,0 AS P0237,0 AS P0238,0 AS P0239"
                + ", 0 AS P0240,0 AS P0241,0 AS P0242,0 AS P0243,0 AS P0244,0 AS P0245,0 AS P0246,0 AS P0247,0 AS P0248,0 AS P0249"
                + ", 0 AS P0250,0 AS P0251,0 AS P0252,0 AS P0253,0 AS P0254,0 AS P0255,0 AS P0256,0 AS P0257,0 AS P0258,0 AS P0259"
                + ", 0 AS P0260,0 AS P0261,0 AS P0262,0 AS P0263,0 AS P0264,0 AS P0265,0 AS P0266,0 AS P0267,0 AS P0268,0 AS P0269"
                + ", 0 AS P0270,0 AS P0271,0 AS P0272,0 AS P0273,0 AS P0274,0 AS P0275,0 AS P0276,0 AS P0277,0 AS P0278,0 AS P0279"
                + ", 0 AS P0280,0 AS P0281,0 AS P0282,0 AS P0283,0 AS P0284,0 AS P0285,0 AS P0286,0 AS P0287,0 AS P0288,0 AS P0289"
                + ", 0 AS P0290,0 AS P0291,0 AS P0292,0 AS P0293,0 AS P0294,0 AS P0295,0 AS P0296,0 AS P0297,0 AS P0298,0 AS P0299"
                + ", 0 AS P0300,0 AS P0301,0 AS P0302,0 AS P0303,0 AS P0304,0 AS P0305,0 AS P0306,0 AS P0307,0 AS P0308,0 AS P0309"
                + ", 0 AS P0310,0 AS P0311,0 AS P0312,0 AS P0313,0 AS P0314,0 AS P0315,0 AS P0316,0 AS P0317,0 AS P0318,0 AS P0319"
                + ", 0 AS P0320,0 AS P0321,0 AS P0322,0 AS P0323,0 AS P0324,0 AS P0325,0 AS P0326,0 AS P0327,0 AS P0328,0 AS P0329"
                + ", 0 AS P0330,0 AS P0331,0 AS P0332,0 AS P0333,0 AS P0334,0 AS P0335,0 AS P0336,0 AS P0337,0 AS P0338,0 AS P0339"
                + ", 0 AS P0340,0 AS P0341,0 AS P0342,0 AS P0343,0 AS P0344,0 AS P0345,0 AS P0346,0 AS P0347,0 AS P0348,0 AS P0349"
                + ", 0 AS P0350,0 AS P0351,0 AS P0352,0 AS P0353,0 AS P0354,0 AS P0355,0 AS P0356,0 AS P0357,0 AS P0358,0 AS P0359"
                + ", 0 AS P0360,0 AS P0361,0 AS P0362,0 AS P0363,0 AS P0364,0 AS P0365,0 AS P0366,0 AS P0367,0 AS P0368,0 AS P0369"
                + ", 0 AS P0370,0 AS P0371,0 AS P0372,0 AS P0373,0 AS P0374,0 AS P0375,0 AS P0376,0 AS P0377,0 AS P0378,0 AS P0379"
                + ", 0 AS P0380,0 AS P0381,0 AS P0382,0 AS P0383,0 AS P0384,0 AS P0385,0 AS P0386,0 AS P0387,0 AS P0388,0 AS P0389"
                + ", 0 AS P0390,0 AS P0391,0 AS P0392,0 AS P0393,0 AS P0394,0 AS P0395,0 AS P0396,0 AS P0397,0 AS P0398,0 AS P0399"
                + ", 0 AS P0400,0 AS P0401,0 AS P0402,0 AS P0403,0 AS P0404,0 AS P0405,0 AS P0406,0 AS P0407,0 AS P0408,0 AS P0409"
                + ", 0 AS P0410,0 AS P0411,0 AS P0412,0 AS P0413,0 AS P0414,0 AS P0415,0 AS P0416,0 AS P0417,0 AS P0418,0 AS P0419"
                + ", 0 AS P0420,0 AS P0421,0 AS P0422,0 AS P0423,0 AS P0424,0 AS P0425,0 AS P0426,0 AS P0427,0 AS P0428,0 AS P0429"
                + ", 0 AS P0430,0 AS P0431,0 AS P0432,0 AS P0433,0 AS P0434,0 AS P0435,0 AS P0436,0 AS P0437,0 AS P0438,0 AS P0439"
                + ", 0 AS P0440,0 AS P0441,0 AS P0442,0 AS P0443,0 AS P0444,0 AS P0445,0 AS P0446,0 AS P0447,0 AS P0448,0 AS P0449"
                + ", 0 AS P0450,0 AS P0451,0 AS P0452,0 AS P0453,0 AS P0454,0 AS P0455,0 AS P0456,0 AS P0457,0 AS P0458,0 AS P0459"
                + ", 0 AS P0460,0 AS P0461,0 AS P0462,0 AS P0463,0 AS P0464,0 AS P0465,0 AS P0466,0 AS P0467,0 AS P0468,0 AS P0469"
                + ", 0 AS P0470,0 AS P0471,0 AS P0472,0 AS P0473,0 AS P0474,0 AS P0475,0 AS P0476,0 AS P0477,0 AS P0478,0 AS P0479"
                + ", 0 AS P0480,0 AS P0481,0 AS P0482,0 AS P0483,0 AS P0484,0 AS P0485,0 AS P0486,0 AS P0487,0 AS P0488,0 AS P0489"
                + ", 0 AS P0490,0 AS P0491,0 AS P0492,0 AS P0493,0 AS P0494,0 AS P0495,0 AS P0496,0 AS P0497,0 AS P0498,0 AS P0499"*/
                + ",SDKEY AS WTEEINZNR, SUBSTR(SDDATEN,62,8) AS VALUE, K.* FROM SDDAT P JOIN TXTIND T ON Txtitxtart='SDF' AND txtisind='0109'||SUBSTR(SDKEY,3)||'                                  '"
                + " JOIN TXTKON K ON TXTIPIND = TXTKPIND"
                 + " WHERE SDSA = '0109' AND SDKEY = :WTEEINZNR:"
                 + " ORDER BY TXTKPIND,TXTKPOS";
            or1.CommandText = INTEXDBC.InjectData(or1.CommandText, dwData);
            SResult = Connect2Proxy(or1);
            SResult.Tables[0].TableName = TableName;

            return SResult;
        }
        public DataSet QWTWV(DataRow dwData)
        {

            or1 = OracleDB.CreateCommand();
            or1.CommandText = "SELECT  0 AS LINE, P.*"
                + ", 0 AS W0000,0 AS W0001,0 AS W0002,0 AS W0003,0 AS W0004,0 AS W0005,0 AS W0006,0 AS W0007,0 AS W0008,0 AS W0009"
                + ", 0 AS W0010,0 AS W0011,0 AS W0012,0 AS W0013,0 AS W0014,0 AS W0015,0 AS W0016,0 AS W0017,0 AS W0018,0 AS W0019"
                + ", 0 AS W0020,0 AS W0021,0 AS W0022,0 AS W0023,0 AS W0024,0 AS W0025,0 AS W0026,0 AS W0027,0 AS W0028,0 AS W0029"
                + ", 0 AS W0030,0 AS W0031,0 AS W0032,0 AS W0033,0 AS W0034,0 AS W0035,0 AS W0036,0 AS W0037,0 AS W0038,0 AS W0039"
                /*
                + ", 0 AS W0040,0 AS W0041,0 AS W0042,0 AS W0043,0 AS W0044,0 AS W0045,0 AS W0046,0 AS W0047,0 AS W0048,0 AS W0049"
                + ", 0 AS W0050,0 AS W0051,0 AS W0052,0 AS W0053,0 AS W0054,0 AS W0055,0 AS W0056,0 AS W0057,0 AS W0058,0 AS W0059"
                + ", 0 AS W0060,0 AS W0061,0 AS W0062,0 AS W0063,0 AS W0064,0 AS W0065,0 AS W0066,0 AS W0067,0 AS W0068,0 AS W0069"
                + ", 0 AS W0070,0 AS W0071,0 AS W0072,0 AS W0073,0 AS W0074,0 AS W0075,0 AS W0076,0 AS W0077,0 AS W0078,0 AS W0079"
                + ", 0 AS W0080,0 AS W0081,0 AS W0082,0 AS W0083,0 AS W0084,0 AS W0085,0 AS W0086,0 AS W0087,0 AS W0088,0 AS W0089"
                + ", 0 AS W0090,0 AS W0091,0 AS W0092,0 AS W0093,0 AS W0094,0 AS W0095,0 AS W0096,0 AS W0097,0 AS W0098,0 AS W0099"
                + ", 0 AS W0100,0 AS W0101,0 AS W0102,0 AS W0103,0 AS W0104,0 AS W0105,0 AS W0106,0 AS W0107,0 AS W0108,0 AS W0109"
                + ", 0 AS W0110,0 AS W0111,0 AS W0112,0 AS W0113,0 AS W0114,0 AS W0115,0 AS W0116,0 AS W0117,0 AS W0118,0 AS W0119"
                + ", 0 AS W0120,0 AS W0121,0 AS W0122,0 AS W0123,0 AS W0124,0 AS W0125,0 AS W0126,0 AS W0127,0 AS W0128,0 AS W0129"
                + ", 0 AS W0130,0 AS W0131,0 AS W0132,0 AS W0133,0 AS W0134,0 AS W0135,0 AS W0136,0 AS W0137,0 AS W0138,0 AS W0139"
                + ", 0 AS W0140,0 AS W0141,0 AS W0142,0 AS W0143,0 AS W0144,0 AS W0145,0 AS W0146,0 AS W0147,0 AS W0148,0 AS W0149"
                + ", 0 AS W0150,0 AS W0151,0 AS W0152,0 AS W0153,0 AS W0154,0 AS W0155,0 AS W0156,0 AS W0157,0 AS W0158,0 AS W0159"
                + ", 0 AS W0160,0 AS W0161,0 AS W0162,0 AS W0163,0 AS W0164,0 AS W0165,0 AS W0166,0 AS W0167,0 AS W0168,0 AS W0169"
                + ", 0 AS W0170,0 AS W0171,0 AS W0172,0 AS W0173,0 AS W0174,0 AS W0175,0 AS W0176,0 AS W0177,0 AS W0178,0 AS W0179"
                + ", 0 AS W0180,0 AS W0181,0 AS W0182,0 AS W0183,0 AS W0184,0 AS W0185,0 AS W0186,0 AS W0187,0 AS W0188,0 AS W0189"
                + ", 0 AS W0190,0 AS W0191,0 AS W0192,0 AS W0193,0 AS W0194,0 AS W0195,0 AS W0196,0 AS W0197,0 AS W0198,0 AS W0199"
                + ", 0 AS W0200,0 AS W0201,0 AS W0202,0 AS W0203,0 AS W0204,0 AS W0205,0 AS W0206,0 AS W0207,0 AS W0208,0 AS W0209"
                + ", 0 AS W0210,0 AS W0211,0 AS W0212,0 AS W0213,0 AS W0214,0 AS W0215,0 AS W0216,0 AS W0217,0 AS W0218,0 AS W0219"
                + ", 0 AS W0220,0 AS W0221,0 AS W0222,0 AS W0223,0 AS W0224,0 AS W0225,0 AS W0226,0 AS W0227,0 AS W0228,0 AS W0229"
                + ", 0 AS W0230,0 AS W0231,0 AS W0232,0 AS W0233,0 AS W0234,0 AS W0235,0 AS W0236,0 AS W0237,0 AS W0238,0 AS W0239"
                + ", 0 AS W0240,0 AS W0241,0 AS W0242,0 AS W0243,0 AS W0244,0 AS W0245,0 AS W0246,0 AS W0247,0 AS W0248,0 AS W0249"
                + ", 0 AS W0250,0 AS W0251,0 AS W0252,0 AS W0253,0 AS W0254,0 AS W0255,0 AS W0256,0 AS W0257,0 AS W0258,0 AS W0259"
                + ", 0 AS W0260,0 AS W0261,0 AS W0262,0 AS W0263,0 AS W0264,0 AS W0265,0 AS W0266,0 AS W0267,0 AS W0268,0 AS W0269"
                + ", 0 AS W0270,0 AS W0271,0 AS W0272,0 AS W0273,0 AS W0274,0 AS W0275,0 AS W0276,0 AS W0277,0 AS W0278,0 AS W0279"
                + ", 0 AS W0280,0 AS W0281,0 AS W0282,0 AS W0283,0 AS W0284,0 AS W0285,0 AS W0286,0 AS W0287,0 AS W0288,0 AS W0289"
                + ", 0 AS W0290,0 AS W0291,0 AS W0292,0 AS W0293,0 AS W0294,0 AS W0295,0 AS W0296,0 AS W0297,0 AS W0298,0 AS W0299"
                + ", 0 AS W0300,0 AS W0301,0 AS W0302,0 AS W0303,0 AS W0304,0 AS W0305,0 AS W0306,0 AS W0307,0 AS W0308,0 AS W0309"
                + ", 0 AS W0310,0 AS W0311,0 AS W0312,0 AS W0313,0 AS W0314,0 AS W0315,0 AS W0316,0 AS W0317,0 AS W0318,0 AS W0319"
                + ", 0 AS W0320,0 AS W0321,0 AS W0322,0 AS W0323,0 AS W0324,0 AS W0325,0 AS W0326,0 AS W0327,0 AS W0328,0 AS W0329"
                + ", 0 AS W0330,0 AS W0331,0 AS W0332,0 AS W0333,0 AS W0334,0 AS W0335,0 AS W0336,0 AS W0337,0 AS W0338,0 AS W0339"
                + ", 0 AS W0340,0 AS W0341,0 AS W0342,0 AS W0343,0 AS W0344,0 AS W0345,0 AS W0346,0 AS W0347,0 AS W0348,0 AS W0349"
                + ", 0 AS W0350,0 AS W0351,0 AS W0352,0 AS W0353,0 AS W0354,0 AS W0355,0 AS W0356,0 AS W0357,0 AS W0358,0 AS W0359"
                + ", 0 AS W0360,0 AS W0361,0 AS W0362,0 AS W0363,0 AS W0364,0 AS W0365,0 AS W0366,0 AS W0367,0 AS W0368,0 AS W0369"
                + ", 0 AS W0370,0 AS W0371,0 AS W0372,0 AS W0373,0 AS W0374,0 AS W0375,0 AS W0376,0 AS W0377,0 AS W0378,0 AS W0379"
                + ", 0 AS W0380,0 AS W0381,0 AS W0382,0 AS W0383,0 AS W0384,0 AS W0385,0 AS W0386,0 AS W0387,0 AS W0388,0 AS W0389"
                + ", 0 AS W0390,0 AS W0391,0 AS W0392,0 AS W0393,0 AS W0394,0 AS W0395,0 AS W0396,0 AS W0397,0 AS W0398,0 AS W0399"
                + ", 0 AS W0400,0 AS W0401,0 AS W0402,0 AS W0403,0 AS W0404,0 AS W0405,0 AS W0406,0 AS W0407,0 AS W0408,0 AS W0409"
                + ", 0 AS W0410,0 AS W0411,0 AS W0412,0 AS W0413,0 AS W0414,0 AS W0415,0 AS W0416,0 AS W0417,0 AS W0418,0 AS W0419"
                + ", 0 AS W0420,0 AS W0421,0 AS W0422,0 AS W0423,0 AS W0424,0 AS W0425,0 AS W0426,0 AS W0427,0 AS W0428,0 AS W0429"
                + ", 0 AS W0430,0 AS W0431,0 AS W0432,0 AS W0433,0 AS W0434,0 AS W0435,0 AS W0436,0 AS W0437,0 AS W0438,0 AS W0439"
                + ", 0 AS W0440,0 AS W0441,0 AS W0442,0 AS W0443,0 AS W0444,0 AS W0445,0 AS W0446,0 AS W0447,0 AS W0448,0 AS W0449"
                + ", 0 AS W0450,0 AS W0451,0 AS W0452,0 AS W0453,0 AS W0454,0 AS W0455,0 AS W0456,0 AS W0457,0 AS W0458,0 AS W0459"
                + ", 0 AS W0460,0 AS W0461,0 AS W0462,0 AS W0463,0 AS W0464,0 AS W0465,0 AS W0466,0 AS W0467,0 AS W0468,0 AS W0469"
                + ", 0 AS W0470,0 AS W0471,0 AS W0472,0 AS W0473,0 AS W0474,0 AS W0475,0 AS W0476,0 AS W0477,0 AS W0478,0 AS W0479"
                + ", 0 AS W0480,0 AS W0481,0 AS W0482,0 AS W0483,0 AS W0484,0 AS W0485,0 AS W0486,0 AS W0487,0 AS W0488,0 AS W0489"
                + ", 0 AS W0490,0 AS W0491,0 AS W0492,0 AS W0493,0 AS W0494,0 AS W0495,0 AS W0496,0 AS W0497,0 AS W0498,0 AS W0499"*/
                + ",SDKEY AS WTEEINZNR, SUBSTR(SDDATEN,62,8) AS VALUE, K.* FROM SDDAT P JOIN TXTIND T ON Txtitxtart='SDF' AND txtisind='0109'||SUBSTR(SDKEY,3)||'                                  '"
                + " JOIN TXTKON K ON TXTIPIND = TXTKPIND"
                 + " WHERE SDSA = '0109' AND SDKEY = :WTEEINZNR:"
                 + " ORDER BY TXTKPIND,TXTKPOS";
            or1.CommandText = INTEXDBC.InjectData(or1.CommandText, dwData);
            SResult = Connect2Proxy(or1);
            SResult.Tables[0].TableName = TableName;

            return SResult;
        }
        public void UpdateWTEINZ(DataRow dwData, int option = 1)
        {
            if (option == 0)
            {
                switch (app.company)
                {
                    case "JLT":
                        UWTE01(dwData);
                        break;
                    case "YGR":
                    case "TST":
                    case "UBT":
                    case "SXN":
                    default:
                        UWTE02(dwData);
                        break;
                }
            }

        }
        public void UWTE01(DataRow dwData)
        {

            or1 = OracleDB.CreateCommand();
            or1.CommandText = "UPDATE WTEINZ SET "
                 + "WTEMANDANT=:WTEMANDANT,"
                 + "WTEEINZNR=:WTEEINZNR,"
                 + "WTESTAKZ=:WTESTAKZ,"
                 + "WTEBEZ=:WTEBEZ,"
                 + "WTEEZ=:WTEEZ,"
                 + "WTEERSFD=:WTEERSFD,"
                 + "WTERAPP=:WTERAPP,"
                 + "WTEEZWBL=:WTEEZWBL,"
                 + "WTEESTBRT=:WTEESTBRT,"
                 + "WTEWBLBRT=:WTEWBLBRT,"
                 + "WTEWBLTL=:WTEWBLTL,"
                 + "WTELSL01=:WTELSL01,"
                 + "WTEGEW01=:WTEGEW01,"
                 + "WTELSR01=:WTELSR01,"
                 + "WTELEER01=:WTELEER01,"
                 + "WTELSL02=:WTELSL02,"
                 + "WTEGEW02=:WTEGEW02,"
                 + "WTELSR02=:WTELSR02,"
                 + "WTELEER02=:WTELEER02,"
                 + "WTELSL03=:WTELSL03,"
                 + "WTEGEW03=:WTEGEW03,"
                 + "WTELSR03=:WTELSR03,"
                 + "WTELEER03=:WTELEER03,"
                 + "WTELSL04=:WTELSL04,"
                 + "WTEGEW04=:WTEGEW04,"
                 + "WTELSR04=:WTELSR04,"
                 + "WTELEER04=:WTELEER04,"
                 + "WTELSL05=:WTELSL05,"
                 + "WTEGEW05=:WTEGEW05,"
                 + "WTELSR05=:WTELSR05,"
                 + "WTELEER05=:WTELEER05,"
                 + "WTEAENDZL=:WTEAENDZL,"
                 + "WTEAENDBEN=:WTEAENDBEN,"
                 + "WTEAENDDAT=:WTEAENDDAT,"
                 + "WTENEUBEN=:WTENEUBEN,"
                 + "WTENEUDAT=:WTENEUDAT,"
                 + "WTEFILLER=:WTEFILLER "
            + " WHERE   WTEMANDANT=:WTEMANDANT AND WTEEINZNR=:WTEEINZNR";
            or1.Parameters.Add("WTEMANDANT", OracleType.NVarChar).Value = dwData["WTEMANDANT"].ToString();
            or1.Parameters.Add("WTEEINZNR", OracleType.NVarChar).Value = dwData["WTEEINZNR"].ToString();
            or1.Parameters.Add("WTESTAKZ", OracleType.NVarChar).Value = dwData["WTESTAKZ"].ToString();
            or1.Parameters.Add("WTEBEZ", OracleType.NVarChar).Value = dwData["WTEBEZ"].ToString();
            or1.Parameters.Add("WTEEZ", OracleType.NVarChar).Value = dwData["WTEEZ"].ToString();
            or1.Parameters.Add("WTEERSFD", OracleType.NVarChar).Value = dwData["WTEERSFD"].ToString();
            or1.Parameters.Add("WTERAPP", OracleType.NVarChar).Value = dwData["WTERAPP"].ToString();
            or1.Parameters.Add("WTEEZWBL", OracleType.NVarChar).Value = dwData["WTEEZWBL"].ToString();
            or1.Parameters.Add("WTEESTBRT", OracleType.NVarChar).Value = dwData["WTEESTBRT"].ToString();
            or1.Parameters.Add("WTEWBLBRT", OracleType.NVarChar).Value = dwData["WTEWBLBRT"].ToString();
            or1.Parameters.Add("WTEWBLTL", OracleType.NVarChar).Value = dwData["WTEWBLTL"].ToString();
            or1.Parameters.Add("WTELSL01", OracleType.NVarChar).Value = dwData["WTELSL01"].ToString();
            or1.Parameters.Add("WTEGEW01", OracleType.NVarChar).Value = dwData["WTEGEW01"].ToString();
            or1.Parameters.Add("WTELSR01", OracleType.NVarChar).Value = dwData["WTELSR01"].ToString();
            or1.Parameters.Add("WTELEER01", OracleType.NVarChar).Value = dwData["WTELEER01"].ToString();
            or1.Parameters.Add("WTELSL02", OracleType.NVarChar).Value = dwData["WTELSL02"].ToString();
            or1.Parameters.Add("WTEGEW02", OracleType.NVarChar).Value = dwData["WTEGEW02"].ToString();
            or1.Parameters.Add("WTELSR02", OracleType.NVarChar).Value = dwData["WTELSR02"].ToString();
            or1.Parameters.Add("WTELEER02", OracleType.NVarChar).Value = dwData["WTELEER02"].ToString();
            or1.Parameters.Add("WTELSL03", OracleType.NVarChar).Value = dwData["WTELSL03"].ToString();
            or1.Parameters.Add("WTEGEW03", OracleType.NVarChar).Value = dwData["WTEGEW03"].ToString();
            or1.Parameters.Add("WTELSR03", OracleType.NVarChar).Value = dwData["WTELSR03"].ToString();
            or1.Parameters.Add("WTELEER03", OracleType.NVarChar).Value = dwData["WTELEER03"].ToString();
            or1.Parameters.Add("WTELSL04", OracleType.NVarChar).Value = dwData["WTELSL04"].ToString();
            or1.Parameters.Add("WTEGEW04", OracleType.NVarChar).Value = dwData["WTEGEW04"].ToString();
            or1.Parameters.Add("WTELSR04", OracleType.NVarChar).Value = dwData["WTELSR04"].ToString();
            or1.Parameters.Add("WTELEER04", OracleType.NVarChar).Value = dwData["WTELEER04"].ToString();
            or1.Parameters.Add("WTELSL05", OracleType.NVarChar).Value = dwData["WTELSL05"].ToString();
            or1.Parameters.Add("WTEGEW05", OracleType.NVarChar).Value = dwData["WTEGEW05"].ToString();
            or1.Parameters.Add("WTELSR05", OracleType.NVarChar).Value = dwData["WTELSR05"].ToString();
            or1.Parameters.Add("WTELEER05", OracleType.NVarChar).Value = dwData["WTELEER05"].ToString();
            or1.Parameters.Add("WTEAENDZL", OracleType.NVarChar).Value = dwData["WTEAENDZL"].ToString();
            or1.Parameters.Add("WTEAENDBEN", OracleType.NVarChar).Value = dwData["WTEAENDBEN"].ToString();
            or1.Parameters.Add("WTEAENDDAT", OracleType.NVarChar).Value = dwData["WTEAENDDAT"].ToString();
            or1.Parameters.Add("WTENEUBEN", OracleType.NVarChar).Value = dwData["WTENEUBEN"].ToString();
            or1.Parameters.Add("WTENEUDAT", OracleType.NVarChar).Value = dwData["WTENEUDAT"].ToString();
            or1.Parameters.Add("WTEFILLER", OracleType.NVarChar).Value = dwData["WTEFILLER"].ToString();
            Connect2Proxy(or1);
        }
        public void UWTE02(DataRow dwData)
        {
            or1.CommandText = "UPDATE WTEINZ SET WTEMANDANT=:WTEMANDANT:,WTEEINZNR=:WTEEINZNR:,WTESTAKZ=:WTESTAKZ:,WTEBEZ=:WTEBEZ:,WTEEZ=:WTEEZ:,WTEERSFD=:WTEERSFD:,WTERAPP=:WTERAPP:,WTEEZWBL=:WTEEZWBL:,WTEESTBRT=:WTEESTBRT:,WTEWBLBRT=:WTEWBLBRT:,WTEWBLTL=:WTEWBLTL:,WTELSL01=:WTELSL01:,WTEGEW01=:WTEGEW01:,WTELSR01=:WTELSR01:,WTELEER01=:WTELEER01:,WTELSL02=:WTELSL02:,WTEGEW02=:WTEGEW02:,WTELSR02=:WTELSR02:,WTELEER02=:WTELEER02:,WTELSL03=:WTELSL03:,WTEGEW03=:WTEGEW03:,WTELSR03=:WTELSR03:,WTELEER03=:WTELEER03:,WTELSL04=:WTELSL04:,WTEGEW04=:WTEGEW04:,WTELSR04=:WTELSR04:,WTELEER04=:WTELEER04:,WTELSL05=:WTELSL05:,WTEGEW05=:WTEGEW05:,WTELSR05=:WTELSR05:,WTELEER05=:WTELEER05:,WTEAENDZL=:WTEAENDZL:,WTEAENDBEN=:WTEAENDBEN:,WTEAENDDAT=:WTEAENDDAT:,WTENEUBEN=:WTENEUBEN:,WTENEUDAT=:WTENEUDAT:,WTEFILLER=:WTEFILLER:"
                  + " WHERE   WTEMANDANT=:WTEMANDANT: AND WTEEINZNR=:WTEEINZNR:";
            or1.CommandText = INTEXDBC.InjectData(or1.CommandText, dwData);
            Connect2Proxy(or1);

        }

    }
}
